//
//  LBShareKeyModel+setKeyModel.m
//  app
//
//  Created by 杨庆人 on 17/4/11.
//  Copyright © 2017年 NAICAI LI. All rights reserved.
//

#import "LBShareKeyModel+setKeyModel.h"

@implementation LBShareKeyModel (setKeyModel)

+ (LBShareKeyModel *)setKeyModelWithChannelKeyModel:(LBChannelKeyModel *)channelKeyModel {

    LBShareKeyModel * model = [[LBShareKeyModel alloc] init];
    
    model.UMSocialKey = channelKeyModel.UMSocialKey;
    
    LBChannelModel * wechatModel = [[LBChannelModel alloc] init];
    wechatModel.appKey = channelKeyModel.wechatModel.appKey;
    wechatModel.appSecret = channelKeyModel.wechatModel.appSecret;
    wechatModel.redirectURL = channelKeyModel.wechatModel.redirectURL;
    wechatModel.platformType = UMSocialPlatformType_WechatSession;
    wechatModel.name = @"微信好友";
    wechatModel.image = [UIImage imageNamed:@"LBShareWechat"];
    
    LBChannelModel * wechatCircleModel = [[LBChannelModel alloc] init];
    wechatCircleModel.appKey = channelKeyModel.wechatModel.appKey;
    wechatCircleModel.appSecret = channelKeyModel.wechatModel.appSecret;
    wechatCircleModel.redirectURL = channelKeyModel.wechatModel.redirectURL;
    wechatCircleModel.platformType = UMSocialPlatformType_WechatTimeLine;
    wechatCircleModel.name = @"朋友圈";
    wechatCircleModel.image = [UIImage imageNamed:@"LBShareFriendship"];
    
    LBChannelModel * QQModel = [[LBChannelModel alloc] init];
    QQModel.appKey = channelKeyModel.QQModel.appKey;
    QQModel.appSecret = channelKeyModel.QQModel.appSecret;
    QQModel.redirectURL = channelKeyModel.QQModel.redirectURL;
    QQModel.platformType = UMSocialPlatformType_QQ;
    QQModel.name = @"QQ";
    QQModel.image = [UIImage imageNamed:@"LBShareQQ"];
    
    LBChannelModel * QzoneModel = [[LBChannelModel alloc] init];
    QzoneModel.appKey = channelKeyModel.QQModel.appKey;
    QzoneModel.appSecret = channelKeyModel.QQModel.appSecret;
    QzoneModel.redirectURL = channelKeyModel.QQModel.redirectURL;
    QzoneModel.platformType = UMSocialPlatformType_Qzone;
    QzoneModel.name = @"QQ空间";
    QzoneModel.image = [UIImage imageNamed:@"LBShareQQzone"];
    
    LBChannelModel * sinaModel = [[LBChannelModel alloc] init];
    sinaModel.appKey = channelKeyModel.sinaModel.appKey;
    sinaModel.appSecret = channelKeyModel.sinaModel.appSecret;
    sinaModel.redirectURL = channelKeyModel.sinaModel.redirectURL;
    sinaModel.platformType = UMSocialPlatformType_Sina;
    sinaModel.name = @"新浪微博";
    sinaModel.image = [UIImage imageNamed:@"LBShareSina"];
    
    model.channelArray = [NSMutableArray arrayWithArray:@[wechatModel,wechatCircleModel,QQModel,QzoneModel,sinaModel]];


    return model;
}

@end
